package com.zlin.test;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.appindexing.Thing;
import com.google.android.gms.common.api.GoogleApiClient;

public class MainActivity extends AppCompatActivity {

    private Button bt1;
    private TextView tv1;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        init();
        setListeners();

    }

    private void init() {
        bt1 = (Button) findViewById(R.id.bt1);
        tv1 = (TextView) findViewById(R.id.tv1);

    }

    private void setListeners() {
        bt1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                tv1.animate().setDuration(5000).alpha(0).setListener(new AnimatorListenerAdapter() {
                    @Override
                    public void onAnimationEnd(Animator animation) {
                        tv1.setAlpha(1);
                        Toast.makeText(MainActivity.this,"完成",Toast.LENGTH_SHORT).show();
                    }

                });
            }
        });
    }

    private void aThread(){
        new Thread(){
            @Override
            public void run() {

            }
        };
    }

}
